Add a GtkSetting for 'shell-shows-desktop'
authorRyan Lortie <desrt@desrt.ca>
Thu, 14 Nov 2013 20:01:19 +0000 (15:01 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 14 Nov 2013 20:03:04 +0000 (15:03 -0500)
Add a GtkSetting for whether the desktop shell is showing the desktop
folder icons.

This is on by default because most desktop shells do show the icons on
the desktop.  We already have a patch in gnome-settings-daemon to bind
this to the org.gnome.desktop.background show-desktop-icons GSettings
key which is off by default on GNOME.

https://bugzilla.gnome.org/show_bug.cgi?id=712302

gdk/wayland/gdkscreen-wayland.c
gdk/wayland/protocol/gtk-shell.xml
gdk/x11/gdksettings.c
gtk/gtksettings.c

index daf9b29be1ebb8cdb46a87f41913169798522d8e..661ecd9ec0b97028eabbd2551196160d0c34e379 100644 (file)
@@ -715,6 +715,9 @@ gdk_wayland_screen_get_setting (GdkScreen   *screen,
   if (strcmp (name, "gtk-shell-shows-menubar") == 0)
     return set_capability_setting (screen, value, GTK_SHELL_CAPABILITY_GLOBAL_MENU_BAR);
 
+  if (strcmp (name, "gtk-shell-shows-desktop") == 0)
+    return set_capability_setting (screen, value, GTK_SHELL_CAPABILITY_DESKTOP_ICONS);
+
   return FALSE;
 }
 
index a4e25653f1902a665dca912036378da7e89bff99..cd6625913b664f39eb6af8c4bdf4116dd2cad938 100644 (file)
@@ -4,6 +4,7 @@
     <enum name="capability">
       <entry name="global_app_menu" value="1"/>
       <entry name="global_menu_bar" value="2"/>
+      <entry name="desktop_icons" value="3"/>
     </enum>
     
     <event name="capabilities">
index 6d2f87d60b76434e76b9466299e31558220d0dfc..f9bc28e206ed343d6c35f1c98c2ca11ad8755f53 100644 (file)
@@ -57,6 +57,7 @@ static const struct {
   {"Gtk/CursorBlinkTimeout",  "gtk-cursor-blink-timeout"},
   {"Gtk/ShellShowsAppMenu",   "gtk-shell-shows-app-menu"},
   {"Gtk/ShellShowsMenubar",   "gtk-shell-shows-menubar"},
+  {"Gtk/ShellShowsDesktop",   "gtk-shell-shows-desktop"},
   {"Gtk/EnablePrimaryPaste",  "gtk-enable-primary-paste"},
   {"Gtk/RecentFilesMaxAge",   "gtk-recent-files-max-age"},
   {"Gtk/RecentFilesEnabled",  "gtk-recent-files-enabled"},
index 329624bb226a5d26365e435cf9892271d226f34f..01f2ef81dd0dfc9d05671153530546309cd6cd0c 100644 (file)
@@ -213,6 +213,7 @@ enum {
   PROP_IM_STATUS_STYLE,
   PROP_SHELL_SHOWS_APP_MENU,
   PROP_SHELL_SHOWS_MENUBAR,
+  PROP_SHELL_SHOWS_DESKTOP,
   PROP_ENABLE_PRIMARY_PASTE,
   PROP_RECENT_FILES_ENABLED
 };
@@ -1529,6 +1530,16 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                              NULL);
   g_assert (result == PROP_SHELL_SHOWS_MENUBAR);
 
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-shell-shows-desktop",
+                                                                   P_("Desktop environment shows the desktop folder"),
+                                                                   P_("Set to TRUE if the desktop environment "
+                                                                      "is displaying the desktop folder, FALSE "
+                                                                      "if not."),
+                                                                   TRUE, GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_SHELL_SHOWS_DESKTOP);
+
   /**
    * GtkSettings:gtk-enable-primary-paste:
    *